]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
overviewControls: Make sure thumbnails expandFraction is bound to visibility
authorJonas Dreßler <verdre@v0yd.nl>
Fri, 31 May 2024 12:58:13 +0000 (15:58 +0300)
committerMarge Bot <marge-bot@gnome.org>
Sat, 8 Jun 2024 02:40:38 +0000 (02:40 +0000)
We set the expand-fraction property of the workspace thumbnails on changes
to their should-show property. The should-show property defaults to true, and
the expand-fraction property defaults to 1. The should-show property gets
updated in the constructor of the ThumbnailsBox though, and it might become
false (that is the case when starting up the shell) during construction.

In this case we're not yet listening to "notify::should-show" in the
ControlsManager, and therefore forget to update the expand-fraction
accordingly. Fix that and ensure the expandFraction is always set to the value
we expect after hiding or showing the thumbnails (we call _updateThumbnailsBox()
from _update(), which we call in the constructor).

This should be the proper fix for the problem that 9bf550da8 (which caused
the workspace thumbnails to never show) originally tried to fix.

Fixes: 9bf550da88 ("overviewControls: Set expandFraction for ws thumbnails to 0 when hidden")
Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/7668
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3323>

js/ui/overviewControls.js

index 8e335d2a520e0632d451039332d8358358c3870a..a52aa85d2127c215cffd6eb7bf6de4330ebd7da1 100644 (file)
@@ -562,8 +562,10 @@ class ControlsManager extends St.Widget {
             duration: animate ? SIDE_CONTROLS_ANIMATION_TIME : 0,
             mode: Clutter.AnimationMode.EASE_OUT_QUAD,
             onComplete: () => {
-                this._thumbnailsBox.visible = thumbnailsBoxVisible;
-                this._thumbnailsBox.expandFraction = 0;
+                this._thumbnailsBox.set({
+                    visible: thumbnailsBoxVisible,
+                    expandFraction: thumbnailsBoxVisible ? 1.0 : 0.0,
+                });
             },
         };